/**
 * Created by Richard Radlherr.
 * Date: 05.06.2006 03:35
 */

using System;

namespace TagTool.GraphicTypes
{
	public class ParseHelper
	{
		public static Object ParseDouble(String description)
		{
			return Convert.ToDouble(description);
		}
		
		public static Object ParseInt(String description)
		{
			return Convert.ToInt32(description);
		}
		
		public static Object ParseVector(String description)
		{
			String s = description.Substring(1, description.Length - 2);
			String [] p = s.Split(';');
			return new PointD(Convert.ToDouble(p[0]), Convert.ToDouble(p[1]), Convert.ToDouble(p[2]));
		}
		
		public static Object ParseColor(String description)
		{
			String s = description.Substring(1, description.Length - 2);
			String [] p = s.Split(';');
			return new Color(Convert.ToDouble(p[0]), Convert.ToDouble(p[1]), Convert.ToDouble(p[2]), Convert.ToDouble(p[3]));
		}
		
		public static Object ParseString(String description)
		{
			return description;
		}
		
		public static Object ParseBoolean(String description)
		{
			if (description.Equals("true")) return true;
			else return false;
		}
	}
}
